<?php
session_start();

include('../inc/config.php');
if(isset($_POST['mkdn'] )){
     $tendn = strtolower($_POST['tendn']);
     $mkdn = md5($_POST['mkdn']);
    
    $sl = "SELECT * FROM quantrivien WHERE tendn ='".$tendn."' AND matkhaudn ='".$mkdn."'";
    $resul = mysql_query($sl);
    $num = mysql_fetch_row($resul);
     
    if($num[0] > 0){
        $u = strtolower($num[1]);
        $p = $num[2];
        if($mkdn == $p){
            $_SESSION['tenadmin'] = $u;
            if($_SESSION['tenadmin'] == ''){
                echo "<script>alert('Bạn nhập sai username hoặc password');</script>";
                echo "<script>window.location='acp_dangnhap.php';</script>";
            }else{
                echo "<script>window.location='index.php';</script>";
            }
            
        }
       
       }else{
                echo "<script>alert('Bạn nhập sai username hoặc password');</script>";
                echo "<script>window.location='acp_dangnhap.php';</script>";
        }
           
    }else{
        echo "lỗi";
    }



?>